package com.team.abs.service;

import java.util.List;

import com.team.abs.dao.userlogin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class registerserviceimpl implements registerservice{
    @Autowired
    private userlogin userlogin;

    @Override
    public int register(String username, String password) {
      //  System.out.println("dofind");
        List<String> find=userlogin.username_find(username);
        if(find.size()>0)
        return -1;
       // System.out.println("id register");
        userlogin.user_id_register(username);
      
       // System.out.println("name register");
        userlogin.username_register(username, password);
       
        return userlogin.user_id_find(username, password).get(0);
      
    }
    
}
